package com.chexiehui.jc.entity;

import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.TimeUtils;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Transient;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import org.greenrobot.greendao.annotation.Generated;

/**
 * Author: SongJun
 * CreateTime: 2020/5/11 0011
 * Company: 贵州华创云科技有限公司
 * Description: 车辆信息
 */
@Entity
public class CarInfo implements Serializable {
    public static final long serialVersionUID = 536871008L;
    @org.greenrobot.greendao.annotation.Id
    private String Id;
    private String Name;//车型名称 ,
    private String SeriesName;//车系名称 ,
    private String Img;//车型图片 ,
    private String TravellicenseImg;//行驶证 ,
    private String DriverslicenseImg;// 驾驶证 ,
    private String Output;//排量 ,
    private String GearBoxName;//变速箱 ,
    private String OutputType;//排放标准 ,
    private String SeatCount;//车型的座位个数 ,
    private String SizeType;//车型尺寸 ,
    private String CarTypeId;
    private String ApplicationState;//申请状态 0申请中 1申请通过 2申请不通过
    private String Opinion;//申请不通过原因

    private String BrandId;
    private String BrandName;
    private String Country;
    private String SeriesType;
    private String SeriesTypeMin;
    private String AgentPrice;
    private boolean DisplayAgentPrice;

    private String NewPrice;
    private int FollowRate;
    private String Status;
    private String SeriesId;
    private String SealYear;

    private String RegistrationYear;
    private String Price;
    private String DrivingDistance;
    private String City;

    private String customerTitle;

    private String UserName;
    private String Photo;
    private String CarAuth;
    private String Tel;
    private String Color;
    private String Content;

    private String DownPayments;
    private String MonthlyLaw;

    @Transient
    private List<CarInfo> ReList;
    @Transient
    private List<String> Imgs;
    @Transient
    private boolean isAddCarFollow;
    @Transient
    private boolean isSelected;

    @Generated(hash = 291575920)
    public CarInfo(String Id, String Name, String SeriesName, String Img, String TravellicenseImg,
            String DriverslicenseImg, String Output, String GearBoxName, String OutputType, String SeatCount,
            String SizeType, String CarTypeId, String ApplicationState, String Opinion, String BrandId,
            String BrandName, String Country, String SeriesType, String SeriesTypeMin, String AgentPrice,
            boolean DisplayAgentPrice, String NewPrice, int FollowRate, String Status, String SeriesId,
            String SealYear, String RegistrationYear, String Price, String DrivingDistance, String City,
            String customerTitle, String UserName, String Photo, String CarAuth, String Tel, String Color,
            String Content, String DownPayments, String MonthlyLaw) {
        this.Id = Id;
        this.Name = Name;
        this.SeriesName = SeriesName;
        this.Img = Img;
        this.TravellicenseImg = TravellicenseImg;
        this.DriverslicenseImg = DriverslicenseImg;
        this.Output = Output;
        this.GearBoxName = GearBoxName;
        this.OutputType = OutputType;
        this.SeatCount = SeatCount;
        this.SizeType = SizeType;
        this.CarTypeId = CarTypeId;
        this.ApplicationState = ApplicationState;
        this.Opinion = Opinion;
        this.BrandId = BrandId;
        this.BrandName = BrandName;
        this.Country = Country;
        this.SeriesType = SeriesType;
        this.SeriesTypeMin = SeriesTypeMin;
        this.AgentPrice = AgentPrice;
        this.DisplayAgentPrice = DisplayAgentPrice;
        this.NewPrice = NewPrice;
        this.FollowRate = FollowRate;
        this.Status = Status;
        this.SeriesId = SeriesId;
        this.SealYear = SealYear;
        this.RegistrationYear = RegistrationYear;
        this.Price = Price;
        this.DrivingDistance = DrivingDistance;
        this.City = City;
        this.customerTitle = customerTitle;
        this.UserName = UserName;
        this.Photo = Photo;
        this.CarAuth = CarAuth;
        this.Tel = Tel;
        this.Color = Color;
        this.Content = Content;
        this.DownPayments = DownPayments;
        this.MonthlyLaw = MonthlyLaw;
    }

    @Generated(hash = 850322869)
    public CarInfo() {
    }

    public boolean isAddCarFollow() {
        return isAddCarFollow;
    }

    public void setAddCarFollow(boolean addCarFollow) {
        isAddCarFollow = addCarFollow;
    }

    public String getId() {
        return Id == null ? "" : Id;
    }

    public void setId(String id) {
        Id = id;
    }

    public String getName() {
        return Name == null ? "" : Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public String getSeriesName() {
        return SeriesName == null ? "" : SeriesName;
    }

    public void setSeriesName(String seriesName) {
        SeriesName = seriesName;
    }

    public String getImg() {
        return Img == null ? " " : Img;
    }

    public void setImg(String img) {
        Img = img;
    }

    public String getTravellicenseImg() {
        return TravellicenseImg == null ? "" : TravellicenseImg;
    }

    public void setTravellicenseImg(String travellicenseImg) {
        TravellicenseImg = travellicenseImg;
    }

    public String getDriverslicenseImg() {
        return DriverslicenseImg == null ? "" : DriverslicenseImg;
    }

    public void setDriverslicenseImg(String driverslicenseImg) {
        DriverslicenseImg = driverslicenseImg;
    }

    public String getOutput() {
        return Output == null ? "" : Output;
    }

    public void setOutput(String output) {
        Output = output;
    }

    public String getGearBoxName() {
        return GearBoxName == null ? "" : GearBoxName;
    }

    public void setGearBoxName(String gearBoxName) {
        GearBoxName = gearBoxName;
    }

    public String getOutputType() {
        return OutputType == null ? "" : OutputType;
    }

    public void setOutputType(String outputType) {
        OutputType = outputType;
    }

    public String getSeatCount() {
        return SeatCount == null ? "" : SeatCount;
    }

    public void setSeatCount(String seatCount) {
        SeatCount = seatCount;
    }

    public String getSizeType() {
        return SizeType == null ? "" : SizeType;
    }

    public void setSizeType(String sizeType) {
        SizeType = sizeType;
    }

    public String getCarTypeId() {
        return CarTypeId == null ? "" : CarTypeId;
    }

    public void setCarTypeId(String carTypeId) {
        CarTypeId = carTypeId;
    }

    public String getApplicationState() {
        return ApplicationState == null ? "0" : ApplicationState;
    }

    public void setApplicationState(String applicationState) {
        ApplicationState = applicationState;
    }

    public String getNewPrice() {
        return NewPrice == null ? "" : NewPrice;
    }

    public String getNewPriceStrUnit() {
        return StringUtils.isEmpty(NewPrice) ? "" :  NewPrice.equals("暂无报价") ? NewPrice :  NewPrice + "万";
    }

    public void setNewPrice(String newPrice) {
        NewPrice = newPrice;
    }

    public int getFollowRate() {
        return FollowRate;
    }

    public String getFollowRateStr() {
        return FollowRate + "%人关注";
    }

    public void setFollowRate(int followRate) {
        FollowRate = followRate;
    }

    public String getStatus() {
        return Status == null ? "" : Status;
    }

    public void setStatus(String status) {
        Status = status;
    }

    public String getSeriesId() {
        return SeriesId == null ? "" : SeriesId;
    }

    public void setSeriesId(String seriesId) {
        SeriesId = seriesId;
    }

    public String getSealYear() {
        return SealYear == null ? "" : SealYear;
    }

    public void setSealYear(String sealYear) {
        SealYear = sealYear;
    }

    public String getBrandId() {
        return BrandId == null ? "" : BrandId;
    }

    public void setBrandId(String brandId) {
        BrandId = brandId;
    }

    public String getBrandName() {
        return BrandName == null ? "" : BrandName;
    }

    public void setBrandName(String brandName) {
        BrandName = brandName;
    }

    public String getCountry() {
        return Country == null ? "" : Country;
    }

    public void setCountry(String country) {
        Country = country;
    }

    public String getSeriesType() {
        return SeriesType == null ? "" : SeriesType;
    }

    public void setSeriesType(String seriesType) {
        SeriesType = seriesType;
    }

    public String getSeriesTypeMin() {
        return SeriesTypeMin == null ? "" : SeriesTypeMin;
    }

    public void setSeriesTypeMin(String seriesTypeMin) {
        SeriesTypeMin = seriesTypeMin;
    }

    public String getAgentPrice() {
        return AgentPrice;
    }

    public boolean isDisplayAgentPrice() {
        return DisplayAgentPrice;
    }

    public void setDisplayAgentPrice(boolean displayAgentPrice) {
        DisplayAgentPrice = displayAgentPrice;
    }

    public String getAgentPriceStr() {
        return DisplayAgentPrice ? ("代理商价格：" + (StringUtils.isEmpty(AgentPrice) ? "未知" :AgentPrice.equals("暂无报价") ? AgentPrice :  AgentPrice + "万")) : "";
    }

    public void setAgentPrice(String agentPrice) {
        AgentPrice = agentPrice;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public String getApplicationStateStr() {
        return getApplicationState().equals("0") ? "未认证" :
                getApplicationState().equals("1") ? "已认证" :
                        getApplicationState().equals("2") ? "认证不通过" : "";
    }

    public String getCustomerTitle() {
        return customerTitle;
    }

    public void setCustomerTitle(String customerTitle) {
        this.customerTitle = customerTitle;
    }

    public String getShowTitle() {
        return getName()/* + "-" + getOutput() + "/" + getGearBoxName() + "/" + getOutputType()*/;
    }

    public String getRegistrationYear() {
        return RegistrationYear == null ? "" : RegistrationYear;
    }

    public String getRegistrationYearStr() {
        if (StringUtils.isTrimEmpty(RegistrationYear)) {
            return "";
        }
        Date d = TimeUtils.string2Date(RegistrationYear);
        if (d == null) {
            return "";
        }
        Calendar c = Calendar.getInstance();
        c.setTime(d);
        return c.get(Calendar.YEAR) + "年";
    }

    public String getRegistrationYearMonthStr() {
        if (StringUtils.isTrimEmpty(RegistrationYear)) {
            return "";
        }
        Date d = TimeUtils.string2Date(RegistrationYear);
        if (d == null) {
            return "";
        }
        return TimeUtils.date2String(d, new SimpleDateFormat("yyyy.MM"));
    }

    public void setRegistrationYear(String registrationYear) {
        RegistrationYear = registrationYear;
    }

    public String getPrice() {
        return Price == null ? "" : Price;
    }

    public String getPriceUnit() {
        return StringUtils.isEmpty(Price) ? "" :  Price.equals("暂无报价") ? Price :  Price + "万";
    }

    public void setPrice(String price) {
        Price = price;
    }

    public String getDrivingDistance() {
        return DrivingDistance == null ? "" : DrivingDistance;
    }

    public String getDrivingDistanceStr() {
        return StringUtils.isTrimEmpty(DrivingDistance) ? "" : DrivingDistance + "万公里";
    }

    public void setDrivingDistance(String drivingDistance) {
        DrivingDistance = drivingDistance;
    }

    public String getCity() {
        return City == null ? "" : City;
    }

    public void setCity(String city) {
        City = city;
    }

    public String getUserName() {
        return UserName == null ? "" : UserName;
    }

    public void setUserName(String userName) {
        UserName = userName;
    }

    public String getPhoto() {
        return Photo == null ? "" : Photo;
    }

    public void setPhoto(String photo) {
        Photo = photo;
    }

    public String getCarAuth() {
        return CarAuth == null ? "" : CarAuth;
    }

    public void setCarAuth(String carAuth) {
        CarAuth = carAuth;
    }

    public String getTel() {
        return Tel == null ? "" : Tel;
    }

    public void setTel(String tel) {
        Tel = tel;
    }

    public String getColor() {
        return Color == null ? "" : Color;
    }

    public void setColor(String color) {
        Color = color;
    }

    public String getContent() {
        return Content == null ? "" : Content;
    }

    public void setContent(String content) {
        Content = content;
    }

    public List<CarInfo> getReList() {
        return ReList == null ? ReList = new ArrayList<>() : ReList;
    }

    public void setReList(List<CarInfo> reList) {
        ReList = reList;
    }

    public String getDownPayments() {
        return this.DownPayments;
    }

    public String getDownPaymentsStr() {
        return "首付" + this.DownPayments + "万";
    }

    public void setDownPayments(String DownPayments) {
        this.DownPayments = DownPayments;
    }

    public String getMonthlyLaw() {
        return this.MonthlyLaw;
    }

    public String getMonthlyLawStr() {
        return "月供" + this.MonthlyLaw + "元";
    }

    public void setMonthlyLaw(String MonthlyLaw) {
        this.MonthlyLaw = MonthlyLaw;
    }

    public String getOpinion() {
        return Opinion == null ? "" : Opinion;
    }

    public void setOpinion(String Opinion) {
        this.Opinion = Opinion;
    }

    public List<String> getImgs() {
        return Imgs;
    }

    public void setImgs(List<String> imgs) {
        Imgs = imgs;
    }

    public boolean getDisplayAgentPrice() {
        return this.DisplayAgentPrice;
    }
}
